@extends('layouts.default')
@section('content')
	<div class="users-filter">
			<div class="heading">Filtros</div>
			<div class="fields">
				<div class="name">
					<label class="label">Nombre: </label><input type="text" />
				</div>
				<div class="first-lastname">
					<label class="label">Primer apellido: </label><input type="text" />
				</div>
				<div class="second-lastname">
					<label class="label">Segundo apellido: </label><input type="text"/>
				</div>
				<div class="email">
					<label class="label">Email: </label><input type="text"/>
				</div>
				<div class="phone">
					<label class="label">Teléfono: </label><input type="text"/>
				</div>
				<div class="controls">
					<a href="#">Buscar</a>
				</div>
			</div>
	</div>
	@if($users->isEmpty())
	<p>No hay usuarios para mostrar.</p>
	@else
	<table class="table" id="users-table">
		<thead>
			<tr>
				<th>Id</th>
				<th>Nombre</th>
				<th>Email</th>
				<th colspan="4">Acciones</th>
			</tr>
		</thead>
		<tbody>
	     @foreach($users as $user)
	     	<tr id="{{$user->pk}}">
	     		<td>{{$user->id}}</td>
	     		<td>{{$user->name." ".$user->first_lastname." ".$user->second_lastname}}</td>
	     		<td>{{$user->email}}</td>
	     		<td><a class="btn more" href="#">Más</a></td>
	     		<td><a class="btn edit" href="#">Editar</a></td>
	     		<td><a class="btn delete" href="#">Borrar</a></td>
	     		<td><a class="btn pw-reset" href="#">Generar contraseña</a></td>
	     	</tr>
	     @endforeach
     	</tbody>
     </table>
     {{$users->links()}}
     @endif
     <div class="user-options">
     	<a href="#" class="btn create">Agregar nuevo usuario</a>
     </div>

    @if(!$trash->isEmpty())
    <div>Usuarios eliminados incluídos en solicitudes</div>
	<table class="table" id="users-trash-table">
		<thead>
			<tr>
				<th>Id</th>
				<th>Nombre</th>
				<th>Email</th>
				<th colspan="2">Acciones</th>
			</tr>
		</thead>
		<tbody>
	     @foreach($trash as $user)
	     	<tr id="{{$user->pk}}">
	     		<td>{{$user->id}}</td>
	     		<td>{{$user->name." ".$user->first_lastname." ".$user->second_lastname}}</td>
	     		<td>{{$user->email}}</td>
	     		<td><a class="btn more" href="#">Más</a></td>
	     		<td><a class="btn restore" href="#">Restaurar</a></td>
	     	<tr>
	     @endforeach
     	</tbody>
     </table>
     {{$trash->links()}}
     @endif
     {{ HTML::style('css/popup.css'); }}
     <script type="text/javascript" src="js/Users.js"></script>
@stop